<?php if(!IS_AJAX){?>
<include file="Public:header" />
<link rel="stylesheet" href="__PUBLIC__/Intesys/AdminX/css/task-daily-index.css">
<style>
.nav-tabs li{height: 50px;}
.seleText{margin-top:3px; border-left:1.5px dashed #6dc5a3; padding-left:40px;}
.seleBox{ background:none; border:none; border-left:1px dashed #6dc5a3;}
.seleIcon{ background:none; color: rgba(0,0,0,0) !important; width:80px; text-decoration:none !important;}
.caret-up{ border-bottom:4px solid #999; border-top:0;}
.selectlist{margin:0; padding:0;}
.selectlist li{list-style-type:none; margin:0; padding:0;padding:5px; border-bottom:1px solid #eee; margin:0 8px;}
.selectlist li:hover{background:#eee;}

.badge{position: absolute;background: red;right: -8px;top: -8px;z-index:5}
</style>
<div class="row states-info">
    <div class="col-lg-12" id="forchart">
        <div class="panel panel-default">
            <section class="panel">
                <header class="panel-heading custom-tab">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a style="width: auto;height: 50px;padding: 0 15px !important;display: block;text-align: center;line-height: 50px;font-size: 16px;font-weight: normal;color: #696969 !important;margin-right: 0;" href="#task2" data-toggle="tab"  data-position='bottom' data-intro='切换到我的工作空间'>我的工作</a>
                        </li>
                        <li class="">
                            <a style="width: auto;height: 50px;padding: 0 15px !important;display: block;text-align: center;line-height: 50px;font-size: 16px;font-weight: normal;color: #696969 !important;margin-right: 0;" href="#team2" data-toggle="tab"  onClick="setTimeout(function(){ $(window).trigger('resize');}, 50);"  data-position='bottom' data-intro='切换到我的团队空间'>我的团队</a>
                        </li>
                    </ul>
                </header>
                <div class="panel-body">
                    <div class="tab-content">
                        <div class="tab-pane active" id="task2">
                            <div class="row" style="color:#000;padding:0 15px;clear:right; margin-bottom:10px;">
                                <div class="timeLine" style="'float:left">
                                	<!--<span style="color: #22b5e5;height: 38px;line-height: 38px;font-size: 16px;">
                                    	<span style="font-size: 20px;color: #22b5e5;"><php>$arr=array('周日','周一','周二','周三','周四','周五','周六','周日','周一','周二','周三','周四','周五');echo $arr[date('w')];</php></span> <php> echo date('m').'月'.date('d').'日　'.date('Y').'年'</php>
                                    </span>-->
                                    <ul class="nav navbar-nav" style="float:right">
                                        <li><a  href="javascript:void(0);"  value="month">本月任务</a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="week">本周任务</a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="6"><php>echo $arr[date('w')+1];</php></a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="5"><php>echo $arr[date('w')+2];</php></a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="4"><php>echo $arr[date('w')+3];</php></a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="3"><php>echo $arr[date('w')+4];</php></a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="2"><php>echo $arr[date('w')+5];</php></a><i></i></li>
                                        <li><a  href="javascript:void(0);"  value="1"><php>echo $arr[date('w')+6];</php></a><i></i></li>
                                        <li class="oclick"><a  href="javascript:void(0);"  value="0">今天</a><i class="triangle"></i></li>
                                    </ul>
                                </div>
                            </div>

                            <div class="">
                                <?php }?>
                                <if condition="getAccessMenu($accessList, 'Intesys', 'Task_daily', 'add')">
                                    <form method="post" id="form1" role="form" class="form-horizontal checkoutform" novalidate action="{:U('Task_daily/insert')}"  data-position="bottom" data-intro="这里可以发布任务" >
                                        <div class="row">
                                            <div class="col-xs-10" style=" position:absolute; width:100%; padding-right:100px">
                                                <div class="input-group m-bot15 iconic-input col-xs-12 pull-left" style="margin:15px 0;">
                                                    <div class="input-group-btn"  data-position="bottom" data-intro="这里选择任务分类">
                                                        <button class="btn btn-default dropdown-toggle typebtn"  type="button" id="typebtn" data-toggle="dropdown">分类 <span class="caret"></span></button>
                                                        <ul class="dropdown-menu" id="formList">
                                                            
                                                        </ul>
                                                        <span class="tab_id"><!--新添加的分类--></span>
                                                    </div>
                                                    <div class="col-xs-5 col-md-6 col-lg-8" style="padding-left:0;"  data-position="bottom" data-intro="在这里填写任务内容">
                                                        <i class="fa icon-edit" style="font-size:16px;z-index: 3;color:#7DBEA6; padding-top:3px;"></i>
                                                        <input type="text" datatype="*"  nullmsg="工作任务名称不能为空" errormsg="不支持特殊字符" style="border:none;" class="form-control" name="title" placeholder="请输入工作任务名称">
                                                    </div>
                                                    <div class="pull-right" style="color:#000;text-align:center;padding:0; height:34px; width:40px;"  data-position="bottom" data-intro="展开可填写任务详细描述，上传文件，还可以发消息体现负责人">
                                                        <a  style="cursor:pointer;color:#65CEA7;text-decoration:none;text-align:center;display:block;margin-top:-7px" onclick="event.preventDefault();" id="btn-slide" title="展开/收起">
                                                            <i class="fa icon-sort-asc" style="font-size:24px;color:#65CEA7;text-align:center"></i>
                                                        </a>
                                                    </div>
                                                    <div class="pull-right" style="width:105px;border-right:1px solid #aaa;height:34px; padding-left:0; position:relative;"  data-position="bottom"  data-intro="选择任务负责人">
                                                        <i class="fa icon-user" style="z-index:3; font-size:14px; position:absolute; left:2px; color:#65CEA6; margin-top:10px;"></i>
                                                        <html:listselect class="btn btn-sm seleText" datatype="*" name="member" multiple="0" url="{:U('Member/selectText')}" title="负责人" id="myfollower"/>
                                                    </div>
                                                    <div class="input-group-btn input-large custom-date-range pull-right" style="width:114px;"data-position="bottom"  data-intro="设置任务截止时间">
                                                        <input placeholder="截止时间" datatype="*" type="text" style="cursor:pointer; background:#fff;border:none; padding-left:5px !important; padding-right:0;" readonly class="form-control datepicker" name="realtime" id="realtime">
                                                        <label for="realtime"><i class="fa icon-calendar" style="z-index:3; font-size:14px; position:absolute; right:2px; color:#65CEA6;" onClick="$(this).prev().trigger('click');"></i></label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xs-2 pull-right" style="margin:17px 0;padding:0; width:60px;"  data-position="bottom"  data-intro="点击即可发布">
                                                <button type="submit" class="btn btn-success btn-sm" style="height:33.99px" id="submit">发布</button>
                                            </div>
                                        </div>
                                        <div class="row">
                                            
                                            <div class="col-md-12" style="padding:0px;">
                                                <div id="fadein" style="display:none">
                                                    <div class="form-group" style="margin-left:20px;width:20%;float:left;">
                                                        <label class="pull-left control-label text-muted">信息发送方式:</label>
                                                        <div class="pull-left icheck minimal text-muted">
                                                            <?php foreach(C('MSG_TYPE_TEXT') as $k=>$v){ ?>
                                                        	 	<div class="square-red">
                                                                    <label class="checkbox-inline ">
                                                                      <input type="checkbox" class="" value="{$k}" name="mode[]">{$v}
                                                                    </label>
                                                                </div>
                                                            <?php } ?>
                                                        </div>
                                                    </div>
                                                    <div style="float:left; margin:0 15px;width:50%;margin-left:8%;">
                                                        <iframe src="{:U('upload')}" appendto="#inputbox" style="height:40px;" class="uploadiframe" filename="img_url[]"></iframe>
                                                        <div id="inputbox"></div>
                                                    </div>
                                                    <section class="panel" style="margin-bottom: 0;">
                                                        <div class="panel-body">
                                                            <div class="form-group">
                                                                <div class="col-sm-12">
                                                                    <textarea rows="3" class="form-control" name="remark" placeholder="请输入内容"></textarea>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </section>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </if>
								<form action="{:U('formList')}" method="post" id="formListform"></form>
                                <!--<div class="col-lg-12 col-md-12" style="border:1px dashed #c1c1c1;color:#000;border-radius:2px 2px 2px 2px;text-align:center;padding:18px 0;clear:right">-->
                                    <!--<p>这里能看到自己每天的工作任务安排和执行情况，您可以：</p>-->
                                    <!--<p>1.在本页填写今日工作安排</p>-->
                                    <!--<p>2.在<a href="#">计划表</a>填写每周/每月工作任务</p>-->
                                <!--</div>-->
     <!--------------------------------------------任务列表 开始--------------------------------------------------------->
                                <div class="col-lg-12 col-md-12" style="clear:left;color:black;font-size: 12px; ">
                                    <form id="nowlistform" action="{:U('Task_daily/nowlist')}">
                                        <input type="hidden" name="time" value="{$time}">
                                        <input type="hidden" name="status" value="">
                                        <input type="hidden" name="type" value="">
                                        <input type="hidden" name="belong" value="">
                                        <input type="hidden" name="important" value="">
                                    </form>
                                    <form id="formupdate1" action="{:U('Task_daily/donelist')}" onSubmit="return updatetasklist($('#donelist'), $('#donelistpage'), $(this));">
                                    </form>

                                    <!--<div class="btn-group menu-box" style="margin-top: -3px;">
                                      <button data-toggle="dropdown" style="margin-right: 16px;font-size: 12px;color: #aaaaaa; border: 0; padding: 0;" class="btn btn-default dropdown-toggle" type="button" id="btnGroupDrop1">
                                          <span class="menu-name">状态</span>
                                          <span class="menu-value"></span>
                                          <span class="caret"></span>
                                      </button>
                                      <ul aria-labelledby="btnGroupDrop1" role="menu" class="dropdown-menu" id="status">
                                          <li><a href="javascript:void(0)">已驳回</a></li>
                                          <li><a href="javascript:void(0)">未开始</a></li>
                                          <li><a href="javascript:void(0)">进行中</a></li>
                                          <li><a href="javascript:void(0)">待审核</a></li>
                                          <li><a href="javascript:void(0)">待评分</a></li>
                                          <li><a href="javascript:void(0)">已通过</a></li>
                                        </ul>
                                    </div>-->
                                    <div class="btn-group menu-box" style="margin-top: -3px;">
                                      <button style="margin-right: 16px;font-size: 12px;  color: #aaaaaa; border: 0; padding: 0;" data-toggle="dropdown" class="btn btn-default dropdown-toggle" type="button" id="btnGroupDrop2">
                                          <span class="menu-name" style="padding-left:5px;">分类</span>
                                          <span class="menu-value"></span>
                                          <span class="caret"></span>
                                      </button>
                                      <ul aria-labelledby="btnGroupDrop2" role="menu" class="dropdown-menu" id="type">
                                          <volist name="table" id="taba">
                                              <li><a href="#" value="{$taba['id']}">{$taba['title']}</a></li>
                                          </volist>
                                      </ul>
                                    </div>
                                    
                                    <div class="btn-group" style="margin-top: -3px;">
                                      <button style="margin-right: 16px;font-size: 12px;  color: #aaaaaa; border: 0; padding: 0;"  class="btn btn-default f-order" type="button" id="timeOrder">
                                          <span class="menu-name" style="padding-left:5px;">时间排序</span>
                                          <span class="menu-value"></span>
                                          <span class="caret"></span>
                                      </button>
                                      <ul class="hidden">
                                      	<li><a name="date" value="1"></a><li>
                                      </ul>
                                    </div>
                                    
                                    <div class="btn-group" style="margin-top: -3px;">
                                      <button style="    margin-right: 16px;font-size: 12px;  color: #aaaaaa; border: 0; padding: 0;" class="btn btn-default f-order" type="button" id="progressOrder">
                                          <span class="menu-name" style="padding-left:5px;">进度排序</span>
                                          <span class="menu-value"></span>
                                          <span class="caret"></span>
                                      </button>
                                      <ul class="hidden">
                                      	<li><a name="progress" value="1"></a><li>
                                      </ul>
                                    </div>
                                    <!--<div class="btn-group menu-box" style="margin-top: -3px;">
                                        <button style="    margin-right: 16px;font-size: 12px;  color: #aaaaaa; border: 0; padding: 0;" data-toggle="dropdown" class="btn btn-default dropdown-toggle" type="button" >
                                            <span class="menu-name">责任人</span>
                                            <span class="menu-value"></span>
                                            <span class="caret"></span>
                                        </button>
                                        <ul aria-labelledby="btnGroupDrop2" role="menu" class="dropdown-menu" id="belong">
                                            <li><a href="#" value="1">由我执行</a></li>
                                            <li><a href="#" value="2">由我发布</a></li>
                                            <li><a href="#" value="3">由我参与</a></li>
                                        </ul>
                                    </div>-->
                                    <!--<a href="javascript:void(0)" value='1' class="important" style="color:#3365FF">轻</a>
                                    <a href="javascript:void(0)" value='2' class="important" style="color:#43E43F">缓</a>
                                    <a href="javascript:void(0)" value='3' class="important" style="color:#E9A94A">重</a>
                                    <a href="javascript:void(0)" value='4' class="important" style="color:#D92D29">急</a>-->
                                </div>
 <!----------------------------------------------------------------nowlist--------------------------------------->
                                <div class="panel-body"  data-position="bottom" data-intro="任务发布成功后这里可以查看"  style="clear:left" >
                                    <div class="planTitl" style="color:white">当前任务 >></div>
                                    <hr style="clear:left;margin:15px 0 35px" />

                                    <div id="nowlist"></div>
                                </div>
                                <div id="nowlistpages" class="text-center">
                                </div>
                                <!-------------------------------------任务列表结束----------------------------------------------------->
                                <!------------------------------------------完成任务表开始----------------------------------------------------------->
                                <div class="panel-body" data-position="top" data-intro="任务完成后在这里显示"  id="donelist">

                                </div>
                                <div id="donelistpages" class="text-center">
                                </div>
    <!----------------------------------------------------完成任务结束-------------------------------------------------------->
                                    <!-- 数据主体 -->
                                <?php if(!IS_AJAX){?>
                            </div>
                        </div>
                        <div class="wrapper tab-pane" id="team2" style="color:#000">
                            <section class="panel">
                                <?php } ?>
                            <div class="col-lg-3"  style="padding:0;" >
                            <form action="{:U('Analysis/chartlist')}" id="myteamform">
                                <div class="panel whitebg  midpanel"   style="margin:0 ">
                                    <header class="panel-heading"> 时间 </header>
                                    <div class="panel-body">
                                        <div class="m-bot15">
                                            <input class="form-control" name="time" readonly  style="cursor:pointer;display: inline; width:auto;margin-bottom:5px" value="" placeholder="查询日期" type="text" id="datepicker">
                                        </div>
                                    </div>
                                </div>
                                </form>
                                <div class="panel botpanel" style="padding:0;margin:0">
                                    <header class="panel-heading"> 选择人员 </header>
                                    <div class="panel-body">
                                        <html:dropdownselect class="memberselect" listloaded="listloaded" selected="" name="member" style="height:auto; width:auto;" multi="0" action="{:U('Team/membergroup')}" title="选择员工" placeholder="点击选择人员" />
                                        <div id="reselectlayout" style="top:0; display:none;  position:fixed; left:0; bottom:0; right:0;  z-index:4999;"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-9" style="padding:0">
                                <div class="panel-body">
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="myteam">
                                            <!-- 数据主体 -->
                                            <!-- 数据主体结束 -->
                                        </div>
                                    </div>
                                </div>
                            </div>
                                <?php if(!IS_AJAX){?>
                            </section>
                        </div>
                    </div>
                </div>
            </section>

            <div class="panel-body">
                <div class="loading hidden">正在加载</div>
                <div class="PagesBox"><?php echo $pages;?></div>
            </div>
        </div>
    </div>
    <div>
        <div class="panel" style="display:none;position:fixed;top:280px" id="hiddentype">
            <header class="panel-heading">
            	修改任务所属分类  
            	<span class="pull-right">
                	<i class="fa icon-times" style="font-size:16px;cursor:pointer" onClick="$('#hiddentype').css('display','none');"></i>
                </span>
            </header>
            <span id="hidspan" value=""></span>
            <div class="panel-body">
                <volist name="table" id="edittab">
                    <a class="btn btn-info" value="{$edittab.id}" style="margin-top:10px;" href="javascript:void(0);" >{$edittab.title}</a>　
                </volist>
            </div>
         
        </div>
    </div>
    </div>
    <include file="Public:script" />
    <script src="__PUBLIC__/Js/highcharts.src.js"></script>
    <script src="__PUBLIC__/Intesys/AdminX/js/task-daily-index.js"></script>

<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/zTree_v3/css/zTreeStyle/zTreeStyle.css">
<script type="text/javascript" src="/Public/Js/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
<script>
    $('#datepicker').datepicker();
    $('#datepicker').change(function(){
        $('#myteamform').submit();
    });
    function listloaded(){
        $('.selectitem').click(function(){
            if($(this).prev('em').length!=0){
                $(this).find('input').eq(0).attr('name','pos_name');
                $(this).find('input').eq(1).attr('name','pos_id');
            }else{
                $(this).find('input').eq(0).attr('name','member_name');
                $(this).find('input').eq(1).attr('name','member_id');
            }
        });
        $('.memberselect').blur(function(){
            $("#myteamform input[name='member_pos_id']").remove();
            $("#myteamform input[name='member_member_id']").remove();
            if($('.memberselect .itemspan').children('input:eq(1)').length!=0){
                $('#myteamform').append("<input type='hidden' name='"+$('.memberselect .itemspan').children("input:eq(1)").attr('name')+"' value='"+$('.memberselect .itemspan').children("input:eq(1)").attr('value')+"'>");
            }
            $('#myteamform').submit();
        });
    }
	//验证表单
	$(".checkoutform:eq(0)").Validform({
			ajaxPost:true,
			tiptype:function(msg, s, data){
				if(s.type == 1){
					$.ThinkBox.success('正在处理，请稍等……',{'delayClose':0,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
				}
				if(s.type == 3){
				$.ThinkBox.error(msg,{'delayClose':500,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
			}
			},
			datatype:{
				"text":function(gets,obj,curform,regxp){
					return true;
				},"image":function(gets,obj,curform,regxp){
					return true;
				}
			},
			callback:function(data){
				$('#nowlistform').submit();
				$('#typebtn').html("分类 <span class='caret'></span>");
				//检测登录 
				$('.ThinkBox-close').trigger('click');
				if(data.status == 0){
					$.ThinkBox.error(data.info,{'delayClose':200}); 
				}else{
					$('#form1')[0].reset();
					$.ThinkBox.success('操作成功',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
					$("#fadein").css('display','none');
					$(this).children('i').addClass('icon-sort-asc');
					$(this).children('i').removeClass('icon-sort-desc');
					$(this).css('marginTop','-7px');
				}
			}
		});
	//当添加完分类之后的回调
	function addform(){
        $('#form1')[0].reset();
        $('#typebtn').html($('#newtype').val()+' <span class="caret"></span>');
		$("#formListform").submit();
	}
    $('#nowlist').ajaxlist();
    $('#formList').ajaxlist();
    $(document).ready(function() {
		//当点击筛选条件时上面显示选中的字
		$(".menu-box li a").click(function(e) {
			$(".menu-box .menu-value").html('');
			$(".menu-box .menu-name").show();
			var box=$(this).parents(".menu-box");
			box.find(".menu-name").hide();
			box.find(".menu-value").html($(this).text());
        });
		//当点击筛选条件的排序
		$(".f-order").click(function(e) {
            $(this).find(".caret").toggleClass("caret-up");
			var data=$(this).next().find("li a");
			var obj=$("#nowlistform input[name='"+data.attr('name')+"'");
			if(obj.val()==1){
				$(".f-orderItem").remove();
				$("#nowlistform").append("<input class='f-orderItem' type='hidden' name='"+data.attr('name')+"' value='0'/>");	
			}else{
				$(".f-orderItem").remove();
				$("#nowlistform").append("<input class='f-orderItem' type='hidden' name='"+data.attr('name')+"' value='1'/>");	
			}
			$("#nowlistform").submit();
        });
        $('.wysihtml5').wysihtml5();
		$('#hiddentype div a').each(function(){
            $(this).click(function(){
                var hidspan=$('#hidspan').attr('value');
                var abtn=$(this).attr('value');
                $.post("{:U('Task_daily/editType')}",{id:hidspan,type_id:abtn},function(data){
                    alert(data);
                    $('#nowlistform').submit();

                    $('#hiddentype').css('display','none');
                });
            });
        });
        $(document).click(function(){
            $('#hiddentype').css('display','none');
        });
		$.post("{:U('Task_daily/donelist')}",function(data){
            $('#donelist').html(data.tbody);
        },'json');
        $.post("{:U('Task_daily/nowlist')}",function(data){
            $('#nowlist').html(data.tbody);
        },'json');
        $.post("{:U('Analysis/chartlist')}",function(data){
            $('#myteam').html(data.tbody);
        },'json');
    });
    $('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' });
    $('#myteam').ajaxlist();
	
	$(window).trigger('load');
</script>
</body></html>
<?php }?>